:root {
  --primary: #4361ee;
  --primary-light: #e0e7ff;
  --secondary: #3a0ca3;
  --accent: #4cc9f0;
  --dark: #2b2d42;
  --light: #ffffff;
  --gray: #f5f7ff;
  --border: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
  background-color: #ffffff;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 90% 10%, rgba(67, 97, 238, 0.03) 0%, transparent 20%),
    radial-gradient(circle at 10% 90%, rgba(76, 201, 240, 0.03) 0%, transparent 20%);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* 头部导航 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  font-size: 2.5rem;
  color: var(--primary);
}

.logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  position: relative;
}

.logo-text::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
  border-radius: 3px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* 核心功能区 */
.features-section {
  margin: 3rem 0 5rem;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--dark);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 100px;
  height: 4px;
  background: linear-gradient(to right, var(--primary), var(--accent));
  margin: 1rem auto;
  border-radius: 2px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2.5rem;
}

.feature-card {
  background: var(--light);
  border-radius: 16px;
  padding: 2.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(67, 97, 238, 0.15);
}

.card-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

.card-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--dark);
}

.card-desc {
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.8;
  font-size: 1.1rem;
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 1rem 2rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  font-size: 1.1rem;
  box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.btn:hover {
  background: var(--secondary);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
}

/* 模态框样式 */
.modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
  transition: all 0.4s ease;
}

.modal-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.close-modal {
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  transition: transform 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-modal:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-body {
  padding: 2rem;
}

/* 表单样式 */
.form-section {
  margin-bottom: 2.5rem;
}

.section-title-small {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title-small i {
  color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.7rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-label.required::after {
  content: '*';
  color: var(--error);
  margin-left: 4px;
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  background: var(--gray);
  position: relative;
}

.upload-area:hover {
  border-color: var(--primary);
}

.upload-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.upload-text {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.upload-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.file-input {
  display: none;
}

.btn-select {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.btn-select:hover {
  background: var(--secondary);
}

/* 下拉选择 */
.select-wrapper {
  position: relative;
}

.select-wrapper select {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-size: 1rem;
  color: var(--text-primary);
  appearance: none;
  transition: var(--transition);
}

.select-wrapper::after {
  content: '\f078';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* 采购包样式 */
.procurement-package {
  background: var(--gray);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.package-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.package-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
}

.remove-package {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  font-size: 1.2rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.remove-package:hover {
  background: rgba(239, 68, 68, 0.1);
}

.radio-group {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radio-item input[type="radio"] {
  width: 18px;
  height: 18px;
}

.add-package {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px dashed var(--primary);
  border-radius: 8px;
  padding: 0.9rem 1.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.add-package:hover {
  background: rgba(67, 97, 238, 0.15);
}

/* 检验结果部分 */
.inspection-results {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.result-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.8rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  transition: var(--transition);
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.record-list {
  max-height: 300px;
  overflow-y: auto;
}

.record-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.record-item:hover {
  background: var(--gray);
}

.record-icon {
  font-size: 1.5rem;
  color: var(--primary);
}

.record-details {
  flex-grow: 1;
}

.record-name {
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.record-meta {
  display: flex;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.record-status {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

/* 标注表 */
.annotation-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.annotation-table th {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  text-align: left;
  padding: 1rem;
}

.annotation-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.annotation-table tr:nth-child(even) {
  background: var(--gray);
}

.annotation-table tr:hover {
  background: rgba(67, 97, 238, 0.05);
}

.marker {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.marker-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.marker-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.marker-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

/* 模态框底部 */
.modal-footer {
  padding: 1.5rem 2rem;
  background: var(--gray);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 1px solid var(--border);
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--secondary);
}

/* 规则模板部分 */
.template-preview {
  background: var(--gray);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  position: relative;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.preview-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.template-item {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.template-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.1);
}

.template-icon {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.template-name {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.template-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.download-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.download-icon {
  font-size: 2.5rem;
  color: var(--success);
}

.download-text {
  flex-grow: 1;
}

.download-title {
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.download-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* 规则匹配框优化 */
.rule-upload-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rule-upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  background: var(--gray);
  position: relative;
  margin-bottom: 1rem;
}

.rule-upload-area:hover {
  border-color: var(--primary);
}

.rule-upload-icon {
  font-size: 3rem;
  color: #2b579a;
  margin-bottom: 1.5rem;
}

.rule-upload-text {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
  font-weight: 500;
}

.rule-upload-hint {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Excel页面样式 */
.excel-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 2000;
  overflow: auto;
  padding: 2rem;
}

.excel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.excel-title {
  font-size: 1.8rem;
  color: var(--dark);
}

.excel-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.excel-cell {
  padding: 0.8rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: white;
  min-height: 50px;
}

.excel-header-cell {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  text-align: center;
}

.excel-cell:nth-child(5n) {
  border-right: none;
}

.excel-grid > div:last-child,
.excel-grid > div:nth-last-child(2),
.excel-grid > div:nth-last-child(3),
.excel-grid > div:nth-last-child(4),
.excel-grid > div:nth-last-child(5) {
  border-bottom: none;
}

.excel-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: flex-end;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .features {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-body {
    padding: 1.5rem;
  }
  
  .template-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .rule-upload-area {
    padding: 1.5rem;
  }
  
  .excel-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .excel-cell:nth-child(3n) {
    border-right: none;
  }
}